package com.jt.service;

import com.jt.pojo.Item;
import com.jt.vo.EasyUITable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.jt.mapper.ItemMapper;

import java.util.List;

@Service
public class ItemServiceImpl implements ItemService {
	
	@Autowired
	private ItemMapper itemMapper;



	@Override
	public EasyUITable findItemByPage(Integer page, Integer rows) {
		Long total = itemMapper.selectCount(null).longValue();
		int startIndex = (page-1)*rows;
		List<Item> listItems = itemMapper.findItemByPage(startIndex,rows);
		return  new EasyUITable(total,listItems);
	}

//	@Override
//	public Long findCounts() {
//		Integer counts = itemMapper.getCount(null);
//		Long countsVal = counts.longValue();
//		return countsVal;
//	}
}
